from typing import Callable


def require_input(tip: str) -> str:
    """
    强制用户输出
    :param tip:
    :return:
    """
    while True:
        user_input = input(tip)
        user_input = user_input.strip()
        if user_input:
            return user_input


def require_input_call(tip: str, call_fn: Callable[[str], str]) -> str:
    """
    强制用户输出，支持回调
    """
    while True:
        user_input = input(tip)
        user_input = user_input.strip()
        user_input = call_fn(user_input)
        if user_input:
            return user_input